/**
 * 生成指定长度的随机字符
 * @param size
 * @returns
 */
export const createRandomStr = (size = 5) => {
  const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
  let str = '';
  while (str.length < 5) {
    str += chars.charAt(Math.round(Math.random() * 36));
  }
  return str;
};

/**
 * 生成随机五位短信验证码
 * @returns
 */
export const createSMS = () => {
  let sms = '';
  while (sms.length < 5) {
    sms += Math.floor(Math.random() * 10);
  }
  return sms;
};
